#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{
	long long past = 0;
	scanf("%lld", &past);
	past %= 86400000;
	int past_hour = 0;
	int past_minute = 0;
	int past_second = 0;
	past_hour = past / 3600000;
	past %= 3600000;
	past_minute = past / 60000;
	past %= 60000;
	past_second = past / 1000;
	printf("%02d:%02d:%02d", past_hour, past_minute, past_second);
	//printf("%d",1000*3600);
	return 0;
}